import 'package:lishopflu/base/base_import.dart';
import 'package:lishopflu/base/view_import.dart';

import 'change_phone_ctl.dart';



class ChangePhonePage extends BasePage<ChangePhoneCtl>{

  @override
  void onCreate(BuildContext mContext) {
    setAppTitle('修改手机号',);
  }

  @override
  Widget pageBody(BuildContext context) {
    return SingleChildScrollView(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [

          Padding(
            padding: EdgeInsets.only(left: 10, right: 10),
            child: Obx(() => CommonWidget.labelEdit('原手机号码', controller.oldCtl.value, hintText: '请输入原手机号', inputType: TextInputType.phone, maxLines: 1, readOnly: true),),
          ),
          CommonWidget.divide(),

          Padding(
            padding: EdgeInsets.only(left: 10, right: 10),
            child: Obx(() => CommonWidget.labelEdit('新手机号码', controller.phoneCtl.value, hintText: '请输入新手机号', inputType: TextInputType.phone, maxLines: 1,),),
          ),
          CommonWidget.divide(),

          Padding(
            padding: EdgeInsets.only(left: 10, right: 10),
            child: Obx(() => CommonWidget.labelEdit('账户密码', controller.pwdCtl.value, hintText: '请输入账户密码', maxLines: 1),),
          ),
          CommonWidget.divide(),

          Padding(
            padding: EdgeInsets.only(top: 100, left: 50, right: 50),
            child: MaterialButton(
              child: Text('确定', style: TextStyle(fontSize: 14, color: Colors.white,),),
              color: Colors.blueAccent,
              padding: EdgeInsets.only(top: 8, bottom: 8,),
              shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
              minWidth: double.infinity,
              onPressed: (){
                controller.change();
              },
            ),
          ),

        ],
      ),
    );
  }
}